﻿@using CloverNet.Authorization.Demo.Manager.Models;
@using CloverNet.Authorization;
@using CloverNet.Common.Extensions;
@{
    ViewBag.Title = "UserRoleList";
}

@helper ShowUserRole()
{
    var i = 0;
    foreach (var item in RolePermissionProvider.Current.Roles)
    {
        Role role = (Role)item.Role;
        <tr @(i % 2 == 0 ? "class='success'" : "")>
            <td>
                @(i + 1)
            </td>
            <td>
                @role.ToString()
            </td>
            <td>
                @role.GetDescription()
            </td>
        </tr>
        i++;
    }
}

<h2>UserRoleList</h2>

<div class="container">
    <div class="row clearfix">
        <div class="col-md-12 column">
            <table class="table table-hover table-striped">
                <thead>
                    <tr>
                        <th>
                            编号
                        </th>
                        <th>
                            编号
                        </th>
                        <th>
                            名称
                        </th>
                    </tr>
                </thead>
                <tbody>
                    @ShowUserRole()
                </tbody>
            </table>
        </div>

    </div>
</div>

